import json
import elu.topic.model as topicModel
from elu.base.handler import BaseHandler

class TopicHandler(BaseHandler):
    def get(self):
        self.render("topic/show.html")


class TopicAPIHandler(BaseHandler):
    def get(self):
        table = topicModel.TopicModel()
        results = table.r()
        self.write(json.dumps(results))


class TopicApplicationAPIHandler(BaseHandler):
    def get(self):
        table = topicModel.TopicApplicationModel()
        results = table.r()
        self.write(json.dumps(results))
